package com.example.api.config;

import org.springframework.boot.autoconfigure.web.servlet.WebMvcRegistrations;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;

/**
 * @Description 自定义WebMvcRegistrations
 * @Author jie.zhao
 * @Date 2021/9/10 15:39
 */
public class ApiVersionWebMvcRegistrations implements WebMvcRegistrations {

    private ApiVersionConfigProperties apiVersionConfigProperties;

    @Override
    public RequestMappingHandlerMapping getRequestMappingHandlerMapping() {
        return new ApiVersionRequestMappingHandlerMapping(apiVersionConfigProperties);
    }

    public ApiVersionWebMvcRegistrations(ApiVersionConfigProperties apiVersionConfigProperties) {
        this.apiVersionConfigProperties = apiVersionConfigProperties;
    }
}
